#include"Thread.hpp"
#include<memory>
#include<unistd.h>

void* thread_run(void* args)
{
    std::string woke_type = static_cast<const char*>(args);
    while(true)
    {
        std::cout <<"我是一个新线程,我正在做:" << woke_type << std::endl;
        sleep(1);
    }
}

int main()
{
    std::unique_ptr<Thread> thread1(new Thread(thread_run,(void*)"hellothread",1));
    std::unique_ptr<Thread> thread2(new Thread(thread_run,(void*)"countthread",2));
    std::unique_ptr<Thread> thread3(new Thread(thread_run,(void*)"textthread",3));
    thread1->join();
    thread2->join();
    thread3->join();
    return 0;
}